Package-level declarations

Types

Link copied to clipboard
@Serializable
data class ForceReply(val inputFieldPlaceholder: String? = null, val selective: Boolean? = null) : Keyboard

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.

Link copied to clipboard
@Serializable
data class InlineKeyboardButton(val text: String, val url: String? = null, val callbackData: String? = null, val webApp: WebAppInfo? = null, val loginUrl: LoginUrl? = null, val switchInlineQuery: String? = null, val switchInlineQueryCurrentChat: String? = null, val switchInlineQueryChosenChat: SwitchInlineQueryChosenChat? = null, val callbackGame: CallbackGame? = null, val pay: Boolean? = null) : Button

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Link copied to clipboard
@Serializable
class InlineKeyboardMarkup : Keyboard
Link copied to clipboard
@Serializable
data class KeyboardButton(val text: String, val requestUsers: KeyboardButtonRequestUsers? = null, val requestChat: KeyboardButtonRequestChat? = null, val requestContact: Boolean? = null, val requestLocation: Boolean? = null, val requestPoll: KeyboardButtonPollType? = null, val webApp: WebAppInfo? = null) : Button

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_users, request_chat, request_contact, request_location, and request_poll are mutually exclusive. Note: request_users and request_chat options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message.

Link copied to clipboard
@Serializable
data class KeyboardButtonPollType(val type: PollType? = null)

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

Link copied to clipboard
@Serializable
data class KeyboardButtonRequestChat(val requestId: Int, val chatIsChannel: Boolean, val chatIsForum: Boolean? = null, val chatHasUsername: Boolean? = null, val chatIsCreated: Boolean? = null, val userAdministratorRights: ChatAdministratorRights? = null, val botAdministratorRights: ChatAdministratorRights? = null, val botIsMember: Boolean? = null, val requestTitle: Boolean? = null, val requestUsername: Boolean? = null, val requestPhoto: Boolean? = null)

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the сhat if appropriate More about requesting chats: https://core.telegram.org/bots/features#chat-and-user-selection

Link copied to clipboard
@Serializable
data class KeyboardButtonRequestUsers(val requestId: Int, val userIsBot: Boolean? = null, val userIsPremium: Boolean? = null, val maxQuantity: Int? = null, val requestName: Boolean? = null, val requestUsername: Boolean? = null, val requestPhoto: Boolean? = null)

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed. More about requesting users: https://core.telegram.org/bots/features#chat-and-user-selection

Link copied to clipboard
@Serializable
data class LoginUrl(val url: String, val forwardText: String? = null, val botUsername: String? = null, val requestWriteAccess: Boolean? = null)

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: Telegram apps support these buttons as of version 5.7.

Link copied to clipboard
@Serializable
sealed class MenuButton

This object describes the bot's menu button in a private chat. It should be one of

Link copied to clipboard
@Serializable
class ReplyKeyboardMarkup : Keyboard
Link copied to clipboard
@Serializable
data class ReplyKeyboardRemove(val selective: Boolean? = null) : Keyboard

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

Link copied to clipboard
@Serializable
data class WebAppData(val data: String? = null, val buttonText: String)

Describes data sent from a Web App to the bot.

Link copied to clipboard
@Serializable
data class WebAppInfo(val url: String)

Describes a Web App.